package com.carrot.uaa.web.controller;

import com.carrot.common.core.domain.R;
import com.carrot.uaa.app.LoginAppService;
import com.carrot.uaa.entity.dto.SmsCaptchaDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录相关接口
 */

@RestController
@RequestMapping("/v1/login/")
@RequiredArgsConstructor
public class LoginController {

    private final LoginAppService loginAppService;

    /**
     * 获取短信验证码
     * @param smsCaptchaDTO
     * @return
     */
    @PostMapping("/getSmsCaptcha")
    public R getSmsCaptcha(@RequestBody SmsCaptchaDTO smsCaptchaDTO) {
        return loginAppService.getSmsCaptcha(smsCaptchaDTO);
    }
}
